home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 February: Tool Chest / Apple Developer CD Series Tool Chest February 1996 (Apple Computer)(1996).iso / Sample Code / AOCE Sample Code / PowerTalk Access Modules / Sample SMSAM / SampleSMSAM Source / CoreGateway / MailGateway.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-07-28  |  3.0 KB  |  99 lines  |  [TEXT/MPS ]

  1. /*
  2.     File:        MailGateway.h
  3.  
  4.     Copyright:    © 1991-1994 by Apple Computer, Inc.
  5.                 All rights reserved.
  6.  
  7.     Part of the AOCE Sample SMSAM Package.  Consult the license
  8.     which came with this software for your specific legal rights.
  9.  
  10. */
  11.  
  12.  
  13.  
  14. #ifndef __MAILGATEWAY__
  15. #define __MAILGATEWAY__
  16.  
  17. #ifndef __BLJSTANDARDINCLUDES__
  18. #include "BLJStandardIncludes.h"
  19. #endif
  20.  
  21. #ifndef    __DIRECTOBJECT__
  22. #include "DirectObject.h"
  23. #endif
  24.  
  25. #ifndef __PASCALSTRING__
  26. #include "PascalString.h"
  27. #endif
  28.  
  29. /***********************************|****************************************/
  30.  
  31. class THalfGateway;
  32. class ATupleKey;
  33. class ADataItem;
  34. class TLetter;
  35.  
  36. /***********************************|****************************************/
  37.  
  38. class TMailGateway : public TDirectObject
  39. {
  40. public:    virtual                     ~TMailGateway();
  41.                 
  42.         //    This sets the gateway up and gets it ready to start running.
  43.         virtual Boolean             Setup(short vRefNum, long dirID, const char* serverName) = 0;    //    this will load the named configuration
  44.     
  45.         //    This 'starts' the gateway off and running.  First, it will initiate the Recovery phase
  46.         //    for each half gateway.  When this is completed by all half gateways, then it will call
  47.         //    the Run() for each half gateway.
  48.         virtual Boolean             Run(void) = 0;
  49.     
  50.         //    This prepares the gateway to shut down.  The gateway won't be fully shut down until the
  51.         //    ReadyToShutDown() returns true.
  52.         virtual Boolean             PrepareToShutDown(long inHowManySeconds) = 0;
  53.         virtual Boolean                ReadyToShutDown(void) = 0;
  54.         virtual Boolean             CancelGatewayShutdown (void) = 0;
  55.         virtual Boolean             ShutDown(void) = 0;
  56.     
  57.         //    These deal with sending a letter from the local system to the remote system.
  58.         virtual Boolean             ReceiveLetter (TLetter *letter, THalfGateway *originatorHalfGateway) = 0;
  59.         virtual Boolean             RereceiveLetter(TLetter* letter, THalfGateway* originatorHalfGateway) = 0;
  60.     
  61.         //
  62.         //    CONFIGURATION / SETUP METHODS
  63.         //    =============================
  64.         //
  65.         virtual Boolean             GetConfigItem(const ATupleKey& key, ADataItem& ) = 0;
  66.         virtual Boolean             SetConfigItem(const ATupleKey& key, const ADataItem& ) = 0;
  67.         virtual Boolean             DeleteConfigItem(const ATupleKey& key) = 0;
  68.         virtual Boolean             GetNthConfigKey(unsigned long index, ATupleKey& key) = 0;
  69.     
  70.         //
  71.         //    STATUS REPORTING / ERROR REPORTING OPTIONS
  72.         //    ==========================================
  73.         //
  74.         virtual Boolean             GetStatusItem(const ATupleKey& key, ADataItem&) = 0;
  75.         virtual Boolean             SetStatusItem(const ATupleKey& key, const ADataItem& ) = 0;
  76.  
  77.         virtual Boolean                GetStatusStr ( CStr255 statusStr ) const;
  78.         virtual Boolean                SetStatusStr ( CStr255 statusStr );
  79.     
  80.  
  81.         virtual Boolean                HandleMonitoringEvent ( const ADataItem& event );
  82.         
  83.         //
  84.         //    MISC METHODS
  85.         //    ============
  86.         //
  87.         
  88.         virtual ostream&             operator >> ( ostream& ) const;
  89.                 
  90.                 
  91. //    Class constructor is  protected because this is an abstract base class.
  92. protected:                            TMailGateway();
  93.  
  94. };
  95.  
  96. /***********************************|****************************************/
  97.  
  98. #endif    // __MAILGATEWAY__
  99.